package com.wj.Controller;

import com.wj.model.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/yml")
@RestController
public class YmlController {
        @Value("${String.value2}")
        private String key1;
        @RequestMapping("/readValue")
        public String readValue(){
            return "从yml读取配置文件，key1:"+key1;
        }

        @Autowired
        private Student student;
        @RequestMapping("/readStu")
        public String readStu(){
                return student.toString();
        }
}
